import React, { Component } from "react";
import { useNavigate } from "react-router-dom";

function news(NewsCom) {
    return (props) => {
        let navigate = useNavigate();
        return <NewsCom {...props} navigate={navigate} />;
    };
}

class News extends Component {
    // componentDidMount() {
    //     setTimeout(() => {
    //         this.props.navigate("/home/message");
    //     }, 2000);
    // }
    render() {
        return (
            <div>
                <ul>
                    <li>news001</li>
                    <li>news002</li>
                    <li>news003</li>
                    <li>news004</li>
                </ul>
            </div>
        );
    }
}

export default news(News);
